package com.iplant.ams.service.po.dms.fault;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.basic.service.po.bpm.BPMTaskBase;

import java.io.Serializable;
import java.util.Calendar;

/**
 * 故障检修（支持流程审批）
 *
 * @author shun.du
 * 2023-8-10 16:22:27
 */
@DBBasePO(TableName = "dms_fault_base_bpm", CheckName = {"Code"},
        Schemas =
                DBSchemas.AMS, CodeAuto = true, CodePrefix = "DFR-{yyyyMMdd}-", CodeNum = 4)
public class DMSFaultBaseBPM extends BPMTaskBase implements Serializable {
    private static final long serialVersionUID = 1L;//序列号

    @DBCondition
    @DBField
    public int DeviceID = 0;//设备ID

    @DBJoin(name = "AssetInfoID", tableName = "dms_device_ledger", tableAsName = "dms_device_ledger1", Schemas =
            DBSchemas.AMS,
            MainTableField = "DeviceID")
    public int AssetInfoID = 0;//设备ID


    @DBJoin(name = "Name", tableName = "ams_asset_list", tableAsName = "asset1", Schemas = DBSchemas.AMS,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=asset1.ID", JoinIndex = 2)
    public String DeviceName = "";//设备名称

    @DBJoin(name = "Code", tableName = "ams_asset_list", tableAsName = "asset1", Schemas = DBSchemas.AMS,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=asset1.ID", JoinIndex = 2)
    public String DeviceCode = "";//设备名称

    @DBCondition
    @DBField
    public int FaultID = 0;//故障代码

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "dms_fault_base", tableAsName = "dms_fault_base1", Schemas = DBSchemas.AMS,
            MainTableField = "FaultID")
    public String FaultCode = "";//故障代码

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Description", tableName = "dms_fault_base", tableAsName = "dms_fault_base2", Schemas =
            DBSchemas.AMS,
            MainTableField = "FaultID")
    public String FaultDescribe = "";//故障代码描述

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String FaultReason = "";//报修原因

    @DBField
    public String FaultRemark = "";//报修备注

    @DBCondition
    @DBField
    public int FaultLevel = 0;//报修等级

    @DBCondition
    @DBField
    public int FaultType = 0;//报修类型

    @DBField
    public String FaultFileUrl = "";//报修附件

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String Position = "";//报修位置

    /**
     * 接收人ID
     */
    @DBField
    public int RecipientID = 0;
    /**
     * 接收人名称
     */
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "mbs_user2", Schemas = DBSchemas.Basic,
            MainTableField = "RecipientID")
    public String RecipientName = "";
    /**
     * 接收时间
     */
    @DBField
    public Calendar ReceptionTime = Calendar.getInstance();
    /**
     * 到场时间
     */
    @DBField
    public Calendar ArrivalTime = Calendar.getInstance();
    /**
     * 是否到场
     */
    @DBField
    public int IsOnSite = 0;

    /**
     * 处置人班组
     */
    @DBField
    public int DisposerClassID = 0;
    /**
     * 部门ID
     */
    @DBJoin(name = "DepartmentID", tableName = "bms_classinfo", tableAsName = "bms_classinfo1", Schemas =
            DBSchemas.Basic,
            MainTableField = "DisposerClassID")
    public int DepartmentID = 0;

    /**
     * 处置人班组名称
     */
    @DBJoin(name = "Name", tableName = "bms_department", tableAsName = "bms_department1", Schemas = DBSchemas.Basic,
            JoinIndex = 2,
            ConditionalJoin = "bms_classinfo1.DepartmentID=bms_department1.ID")
    public String DisposerClassName = "";

    /**
     * 处置人ID
     */
    @DBField
    public int DisposerID = 0;
    /**
     * 处置人名称
     */
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "mbs_user3", Schemas = DBSchemas.Basic,
            MainTableField = "DisposerID")
    public String DisposerName = "";

    /**
     * 完工时间
     */
    @DBField
    public Calendar CompletionTime = Calendar.getInstance();

    /**
     * 新故障代码
     */
    @DBField
    public String NewFaultCode = "";
    /**
     * 新故障描述
     */
    @DBField
    public String NewFaultDescription = "";
    /**
     * 新处置办法
     */
    @DBField
    public String NewFaultMethods = "";
    /**
     * 新故障附件
     */
    @DBField
    public String NewFaultUrls = "";

    @JsonProperty("DeviceID")
    public int getDeviceID() {
        return DeviceID;
    }

    public void setDeviceID(int deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceName")
    public String getDeviceName() {
        return DeviceName;
    }

    public void setDeviceName(String deviceName) {
        DeviceName = deviceName;
    }

    @JsonProperty("FaultCode")
    public String getFaultCode() {
        return FaultCode;
    }

    public void setFaultCode(String faultCode) {
        FaultCode = faultCode;
    }

    @JsonProperty("FaultReason")
    public String getFaultReason() {
        return FaultReason;
    }

    public void setFaultReason(String faultReason) {
        FaultReason = faultReason;
    }

    @JsonProperty("FaultRemark")
    public String getFaultRemark() {
        return FaultRemark;
    }

    public void setFaultRemark(String faultRemark) {
        FaultRemark = faultRemark;
    }

    @JsonProperty("FaultLevel")
    public int getFaultLevel() {
        return FaultLevel;
    }

    public void setFaultLevel(int faultLevel) {
        FaultLevel = faultLevel;
    }

    @JsonProperty("FaultType")
    public int getFaultType() {
        return FaultType;
    }

    public void setFaultType(int faultType) {
        FaultType = faultType;
    }

    @JsonProperty("FaultFileUrl")
    public String getFaultFileUrl() {
        return FaultFileUrl;
    }

    public void setFaultFileUrl(String faultFileUrl) {
        FaultFileUrl = faultFileUrl;
    }

    @JsonProperty("AssetInfoID")
    public int getAssetInfoID() {
        return AssetInfoID;
    }

    public void setAssetInfoID(int assetInfoID) {
        AssetInfoID = assetInfoID;
    }

    @JsonProperty("FaultID")
    public int getFaultID() {
        return FaultID;
    }

    public void setFaultID(int faultID) {
        FaultID = faultID;
    }

    @JsonProperty("FaultDescribe")
    public String getFaultDescribe() {
        return FaultDescribe;
    }

    public void setFaultDescribe(String faultDescribe) {
        FaultDescribe = faultDescribe;
    }

    @JsonProperty("Position")
    public String getPosition() {
        return Position;
    }

    public void setPosition(String position) {
        Position = position;
    }

    @JsonProperty("RecipientID")
    public int getRecipientID() {
        return RecipientID;
    }

    public void setRecipientID(int recipientID) {
        RecipientID = recipientID;
    }

    @JsonProperty("RecipientName")
    public String getRecipientName() {
        return RecipientName;
    }

    public void setRecipientName(String recipientName) {
        RecipientName = recipientName;
    }

    @JsonProperty("ReceptionTime")
    public Calendar getReceptionTime() {
        return ReceptionTime;
    }

    public void setReceptionTime(Calendar receptionTime) {
        ReceptionTime = receptionTime;
    }

    @JsonProperty("ArrivalTime")
    public Calendar getArrivalTime() {
        return ArrivalTime;
    }

    public void setArrivalTime(Calendar arrivalTime) {
        ArrivalTime = arrivalTime;
    }

    @JsonProperty("DisposerClassID")
    public int getDisposerClassID() {
        return DisposerClassID;
    }

    public void setDisposerClassID(int disposerClassID) {
        DisposerClassID = disposerClassID;
    }

    @JsonProperty("DepartmentID")
    public int getDepartmentID() {
        return DepartmentID;
    }

    public void setDepartmentID(int departmentID) {
        DepartmentID = departmentID;
    }

    @JsonProperty("DisposerClassName")
    public String getDisposerClassName() {
        return DisposerClassName;
    }

    public void setDisposerClassName(String disposerClassName) {
        DisposerClassName = disposerClassName;
    }

    @JsonProperty("DisposerID")
    public int getDisposerID() {
        return DisposerID;
    }

    public void setDisposerID(int disposerID) {
        DisposerID = disposerID;
    }

    @JsonProperty("DisposerName")
    public String getDisposerName() {
        return DisposerName;
    }

    public void setDisposerName(String disposerName) {
        DisposerName = disposerName;
    }

    @JsonProperty("CompletionTime")
    public Calendar getCompletionTime() {
        return CompletionTime;
    }

    public void setCompletionTime(Calendar completionTime) {
        CompletionTime = completionTime;
    }

    @JsonProperty("NewFaultCode")
    public String getNewFaultCode() {
        return NewFaultCode;
    }

    public void setNewFaultCode(String newFaultCode) {
        NewFaultCode = newFaultCode;
    }

    @JsonProperty("NewFaultDescription")
    public String getNewFaultDescription() {
        return NewFaultDescription;
    }

    public void setNewFaultDescription(String newFaultDescription) {
        NewFaultDescription = newFaultDescription;
    }

    @JsonProperty("NewFaultMethods")
    public String getNewFaultMethods() {
        return NewFaultMethods;
    }

    public void setNewFaultMethods(String newFaultMethods) {
        NewFaultMethods = newFaultMethods;
    }

    @JsonProperty("NewFaultUrls")
    public String getNewFaultUrls() {
        return NewFaultUrls;
    }

    public void setNewFaultUrls(String newFaultUrls) {
        NewFaultUrls = newFaultUrls;
    }
    @JsonProperty("IsOnSite")
    public int getIsOnSite() {
        return IsOnSite;
    }
    public void setIsOnSite(int isOnSite) {
        IsOnSite = isOnSite;
    }
}
